<?php include "./configs/session_check.php";
include "./configs/config.php";
sleep(1);

	$ProjectID=$_POST['ProjectID'];
    $AssigneTo=$_POST['AssigneTo'];
    $TaskTitle=$_POST['TaskTitle'];
    $MinutesRequired=$_POST['MinutesRequired'];
	$LineManager=$_POST['LineManager'];
	$Priority=$_POST['Priority'];
	$TaskDetails=$_POST['TaskDetails'];
	
     $query=("INSERT INTO Tasks(ProjectID,AssigneTo,TaskTitle,TaskDetails,MinutesRequired,LineManager,Priority) 			 VALUES('$ProjectID','$AssigneTo','$TaskTitle','$TaskDetails','$MinutesRequired','$LineManager','$Priority')");
    $exc_query=mysql_query($query);
   
    if($exc_query ){
		$task_id=mysql_query("SELECT * FROM Tasks ORDER BY TaskID DESC LIMIT 1");
		$task_id_data=mysql_fetch_array($task_id);
        $return['msg'] = 'Task ID'.$task_id_data['TaskID'].' Added';
    }
    else
    {
        $return['msg'] = 'Failed';
    }

echo json_encode($return);